package eg.backend.repository;

import java.util.Date;
import java.util.List;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import eg.backend.base.repository.EntityRepository;
import eg.backend.domain.Expense;

@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public interface ExpenseRepository extends EntityRepository<Expense, String> {
	List<Expense> findDaily(Date from, Date to, String user);

	List<Expense> findChildrenByDimension(String dimension);
	
	Date findMinDate(String userId);

	Date findMaxDate(String userId);
	
	Double getTotalOfCategory(List<String> categories, Date from, Date to, String userId);

	Double getTotalOfTag(Date from, String tagName, Date to, String userId);
}